
// import 'package:fluttertrip/models/common_model.dart';
// import 'package:fluttertrip/models/config_model.dart';
// import 'package:fluttertrip/models/grid_nav_model.dart';
// import 'package:fluttertrip/models/sales_box_model.dart';

import 'package:flutter_trip/models/sales_box_model.dart';

import 'common_model.dart';
import 'config_model.dart';
import 'grid_nav_model.dart';

class HomeModel{
  final ConfigModel config;
  final List<CommonModel> bannerList;
  final List<CommonModel> localNaviList;
  final List<CommonModel> subNaviList;
  final GridNavModel gridNav;
  final SalesBoxModel salesBox;


  HomeModel(this.config, this.bannerList, this.localNaviList, this.subNaviList,
      this.gridNav, this.salesBox);

  factory HomeModel.fromJson(Map<String,dynamic>json){
    var bannerListJson =json['bannerList'] as List;
    List <CommonModel> bannerList = bannerListJson.map((e) => CommonModel.fromJson(e)).toList();

    var localNaviListJson =json['localNavList'] as List;
    List <CommonModel> localNaviList = localNaviListJson.map((e) => CommonModel.fromJson(e)).toList();

    var subNaviListJson =json['subNavList'] as List;
    List <CommonModel> subNaviList = subNaviListJson.map((e) => CommonModel.fromJson(e)).toList();


    return HomeModel(
        ConfigModel.fromJson(json['config']),
        bannerList,
        localNaviList,
        subNaviList,
        GridNavModel.fromJson(json['gridNav']),
        SalesBoxModel.fromJson(json['salesBox']));
    
  }

}